<template>
    <div>
      {{names}}
      <button @click="func">click me acquire store</button>
    </div>
</template>

<script>
    export default {
        name: "store",
      data(){
          return {
            names:this.$store.state.name
          }
      }
      ,methods:{
          func:function(){
            //通过commit 进行触发函数修改当前的state中的值
            this.$store.commit("CHANGESELECTED",{name:"李四"})
            console.log(this.$store.state.name)
        }
      }
    }
</script>

<style scoped>

</style>
